{
  "properties" : { },
  "id" : "5db82d78fe394f688028a34e790539f3",
  "script" : null,
  "groupId" : "6ecba9cf8cce4bd0bb9cced584f044f5",
  "name" : "查询字典",
  "createTime" : 1718810324469,
  "updateTime" : 1712240166019,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "管理员",
  "path" : "list",
  "method" : "GET",
  "parameters" : [ {
    "name" : "current",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "Integer",
    "type" : null,
    "defaultValue" : "1",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "limit",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "Integer",
    "type" : null,
    "defaultValue" : "10",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "orderProperty",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "orderSort",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "key",
    "value" : "",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "desc",
    "value" : "",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import com.gitee.fastmybatis.core.query.Sort
import com.alibaba.fastjson.JSON;
import com.gitee.fastmybatis.core.query.Query;
import 'com.wiwf.model.mapper.admin.dao.SysDictMapper' as dictMapper;
import 'com.wiwf.model.mapper.admin.dao.SysDictItemsMapper' as dictItemsMapper;


var query = new Query().page(current, limit);

if(key){
    query.likeRight('`key`',key);
}
if(desc){
    query.likeRight('`desc`',desc);
}


var selectData = dictMapper.page(query);
var resData = JSON.toJSON(selectData);
resData.list = [];

for (dict in selectData.list) {
    var newDict = {
        "id": dict.id, "key": dict.key,
        "desc": dict.desc, "type": dict.type,
        "children": []
    }
    newDict.children = dictItemsMapper.list(new Query().eq('dict_id',dict.id));


    resData.list.add(newDict);

}

return resData